home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
program
/
isms.lha
/
isms.Bak
/
isms.amosSourceCode
Wrap
AMOS Source Code
|
1995-10-24
|
5KB
|
163 lines
'
' Intelligent Screen Manager System - ISMS V1.0 for AMOSPro
'
' by Miroslaw Siedlarz (siedlarz@felix.univ.szczecin.pl
'
' it is used in main program LIGA 2.0 which i upload shortly
' to Aminet ( 'biz/dbase/Liga2.lha' )
_NUM_SCR=10 : Rem number of different pictures to be displayed
' each picture has different identification number (0-4)
Dim _SCR(_NUM_SCR)
Global _SCR(),_NUM_SCR
Flash Off
Pen 3 : Paper 0
Do
Locate 0,0 : Cls 0
Print
Print " ID - picture identifier"
Print "PIC_NAME - name of the picture"
Print " CALLS - number of calls to this picture"
Print " SCREEN - number of amos screen on which picture is displayed "
Print " 0 means that picture is not on any amos screen"
Print
Print " ID PIC_NAME CALLS SCREEN"
Print
Print " 1 1.iff ",Str$(_SCR(1)/100),'','',Str$(_SCR(1) mod 100)
Print " 2 2.iff ",Str$(_SCR(2)/100),'','',Str$(_SCR(2) mod 100)
Print " 3 3.iff ",Str$(_SCR(3)/100),'','',Str$(_SCR(3) mod 100)
Print " 4 4.iff ",Str$(_SCR(4)/100),'','',Str$(_SCR(4) mod 100)
Print " 5 5.iff ",Str$(_SCR(5)/100),'','',Str$(_SCR(5) mod 100)
Print " 6 6.iff ",Str$(_SCR(6)/100),'','',Str$(_SCR(6) mod 100)
Print " 7 7.iff ",Str$(_SCR(7)/100),'','',Str$(_SCR(7) mod 100)
Print " 8 8.iff ",Str$(_SCR(8)/100),'','',Str$(_SCR(8) mod 100)
Print " 9 9.iff ",Str$(_SCR(9)/100),'','',Str$(_SCR(9) mod 100)
Print " 10 10.iff ",Str$(_SCR(10)/100),'','',Str$(_SCR(10) mod 100)
Print
Input " enter number of picture identifier you want to show = ";NUM
If NUM>0 and NUM<11
'
' call procedure and move screen to the front of display
'
Proc _LOAD_SCREEN[NUM]
If Param=True
Screen To Front _SCR(NUM) mod 100
End If
'
'
Repeat : Until Inkey$<>""
'
'
Screen 0
Screen To Front 0
'
'
'
End If
Loop
'
'
'
Procedure _LOAD_SCREEN[ID]
'
' search for screen number with the highest number of calls
' that new opened screen or called screen will get this number
' increased by 1
'
Change Mouse 5
For X=1 To _NUM_SCR
MX=Max(MX,_SCR(X)/100)
Next X
Inc MX
'
' if picture (ID) is in mwmory then add one call to the table
'
If _SCR(ID)>0
_SCR(ID)=MX*100+(_SCR(ID) mod 100)
Screen _SCR(ID) mod 100
Else
'
' if picture (ID) is not in memory then i try to fid
' empty screen
'
Do
'
' searching for empty screen
'
For X=1 To 7
Trap Screen X
Exit If Errtrap
Next X
'
' X=8 means that all screens are currently used (no empty screen)
' so i must delete which has the smallest number of calls
' in fact it is the most useless
' also i must delete that screen in case of low memory (e.g. <200kb)
'
If X=8 or Chip Free+Fast Free<200000
'
' searching for lowest number of calls so it will be deleted
'
For X=1 To _NUM_SCR
If _SCR(X)>0
If MI=0
MI=_SCR(X)/100
Else
MI=Min(MI,_SCR(X)/100)
End If
End If
Next X
'
' searching for screen wich has number searched above
'
For X=1 To _NUM_SCR
Exit If _SCR(X)/100=MI
Next X
'
'
'
If _SCR(X) mod 100>0
Screen Close _SCR(X) mod 100
Screen 0
Print
Print " in consequence of low memory or no empty screens"
Print " i must delete screen with the lowest number of calls"
Print "and this is screen number '"+Str$(_SCR(X) mod 100)
Print " press any key to continue"
Wait Key
_SCR(X)=0
Else
Change Mouse 4
Pop Proc[False]
End If
Else
Exit
End If
Loop
'
' loading picture on screen number X
'
If ID=1 : NAME_PIC$="1.IFF" : End If
If ID=2 : NAME_PIC$="2.IFF" : End If
If ID=3 : NAME_PIC$="3.IFF" : End If
If ID=4 : NAME_PIC$="4.IFF" : End If
If ID=5 : NAME_PIC$="5.IFF" : End If
If ID=6 : NAME_PIC$="6.IFF" : End If
If ID=7 : NAME_PIC$="7.IFF" : End If
If ID=8 : NAME_PIC$="8.IFF" : End If
If ID=9 : NAME_PIC$="9.IFF" : End If
If ID=10 : NAME_PIC$="10.IFF" : End If
'
Load Iff NAME_PIC$,X
Screen To Back X
_SCR(ID)=MX*100+X
End If
End Proc[True]